#ifndef __BSP_TOUCHPAD_H__
#define __BSP_TOUCHPAD_H__

#include "bsp_tim_conf.h"

#define TPAD_TIMx             TIM2
#define TPAD_TIM_CLK          RCC_APB1Periph_TIM2

#define TPAD_TIM_Channel_X    TIM_Channel_1
#define TPAD_TIM_IT_CCx       TIM_IT_CC1
#define TPAD_TIM_GetCaptureX  TIM_GetCapture1
#define TPAD_TIM_PERIOD       0XFFFF
#define TPAD_TIM_PSC          (21-1)

#define TPAD_ARR_MAX_VAL      0XFFFF
#define TPAD_TIM_GPIO_CLK     RCC_AHB1Periph_GPIOA
#define TPAD_TIM_CH_PORT      GPIOA
#define TPAD_TIM_CH_PIN       GPIO_Pin_5
#define TPAD_TIM_AF           GPIO_AF_TIM2
#define TPAD_TIM_SOURCE       GPIO_PinSource5

//#define TPAD_GATE_VAL         30
#define TPAD_DEFAULT_VAL_MIN  30
#define TPAD_DEFAULT_VAL_MAX  35
#define TPAD_ON               1
#define TPAD_OFF              0



unsigned char TPAD_Init(void);
unsigned char TPAD_Scan(unsigned char mode);


#endif

